[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
isalnum() Test for Alphanumeric Character (Macro)
#include <ctype.h>
int isalnum(c);
int c; Integer to be tested
isalnum() tests whether 'c' is an alphanumeric character; that is, if
it is included in the set:
'A'-'Z', 'a'-'z', or '0'-'9'
Returns: True (nonzero) if the integer is in one of the sets,
and 0 if not. The result is undefined if 'c' is
other than an ASCII character or EOF.
Notes: isalnum() is a macro.
-------------------------------- Example ---------------------------------
The following statements continue to get input from stdin until a
non-alphanumeric character is read.
#include <ctype.h>
#include <stdio.h>
int x = 0;
char buffer[80];
int ch;
main()
{
while (isalnum(ch = getche()))
buffer[x++] = ch;
printf("data input from console: %s \n",buffer);
}
See Also:
isalpha()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson